package tmplateFun

import (
	"time"

	"ycoem/lib/util"

	"github.com/tidwall/gjson"
)

func GetJsonValue(jsonStr, key string) (value string) {

	res := gjson.Get(jsonStr, key)
	return res.String()
}

func NumberTransfer(num int) string {
	//首页
	numMap := map[int]string{
		1:  "一",
		2:  "二",
		3:  "三",
		4:  "四",
		5:  "五",
		6:  "六",
		7:  "七",
		8:  "八",
		9:  "九",
		10: "十",
	}
	return numMap[num+1]
}
func TimeFormat(str string) string {
	lastLoginTime, _ := time.ParseInLocation(util.TimeFormat, str, time.Local)
	return lastLoginTime.Format(util.TimeFormatDay3)
}
